package com.kexio.file.domain.enums;

/**
 * 存储类型枚举
 * 
 * @author kexio
 */
public enum StorageType {
    
    /** 本地存储 */
    LOCAL("local", "本地存储"),
    
    /** MinIO对象存储 */
    MINIO("minio", "MinIO对象存储"),
    
    /** 阿里云OSS */
    ALIYUN_OSS("aliyun-oss", "阿里云对象存储"),
    
    /** 腾讯云COS */
    TENCENT_COS("tencent-cos", "腾讯云对象存储"),
    
    /** 七牛云 */
    QINIU("qiniu", "七牛云存储"),
    
    /** 华为云OBS */
    HUAWEI_OBS("huawei-obs", "华为云对象存储"),
    
    /** 百度云BOS */
    BAIDU_BOS("baidu-bos", "百度云对象存储"),
    
    /** Amazon S3 */
    AWS_S3("aws-s3", "Amazon S3"),
    
    /** Azure Blob Storage */
    AZURE_BLOB("azure-blob", "Azure Blob Storage");

    private final String code;
    private final String description;

    StorageType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() { return code; }
    public String getDescription() { return description; }

    /**
     * 根据代码获取存储类型
     */
    public static StorageType fromCode(String code) {
        for (StorageType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("Unknown storage type: " + code);
    }
}
